<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>React02</title>

</head>

<body>
  <div class="container"></div>

  <!-- react核心库 -->
  <script src="./js/react.development.js"></script>
  <!-- react拓展库 用于支持react操作dom -->
  <script src="./js/react-dom.development.js"></script>
  <script src="./js/babel.min.js"></script>
  <script type="text/babel">
    const vdom = (
      <h1 id="title">
        <span>Hello, React!</span>
      </h1>
    )

    // 1.创建虚拟DOM
    // const VDOM = React.createElement('h1', { id: 'title' }, 'Hello,React')
    // 会导致层层嵌套
    // const VDOM = React.createElement('h1', { id: 'title' }, React.createElement('span', {}, 'Hello,React'))

    ReactDOM.render(vdom, document.querySelector('.container'))
  </script>
</body>

</html>